#ifndef CLICKEDLABEL_H
#define CLICKEDLABEL_H

#include <QLabel>
#include <QWidget>
#include <QEvent>

#include "global.h"

class ClickedLabel : public QLabel
{
    Q_OBJECT
public:
    ClickedLabel(QWidget* parent=nullptr);

    virtual void mousePressEvent(QMouseEvent* ev) override;
    virtual void enterEvent(QEnterEvent* event) override;  // Qt 5+ 使用 QEnterEvent
    virtual void leaveEvent(QEvent *event) override;

    void SetState(QString normal="", QString hover="", QString press="",
                  QString select="", QString select_hover="", QString select_press="");

    ClickLbState GetCurState();
private:
    QString _normal;
    QString _normal_hover;
    QString _normal_press;

    QString _selected;
    QString _selected_hover;
    QString _selected_press;

    ClickLbState _curstate;
signals:
    // void clicked(QString, ClickLbState);
    void clicked(void);
};

#endif // CLICKEDLABEL_H
